package com.maila.simplerecord.view;

import android.app.DatePickerDialog;
import android.content.Context;
import android.widget.DatePicker;

/**
 * 自定义DatePickerDialog，用于修改标题
 */
public class CustomDatePickerDialog extends DatePickerDialog {
    private String titleContent;

    public CustomDatePickerDialog(Context context, int theme, OnDateSetListener callBack, int year, int monthOfYear, int dayOfMonth, String title) {
        super(context,theme, callBack, year, monthOfYear, dayOfMonth);
        titleContent = title;
        setTitle(titleContent);
    }

    @Override
    public void onDateChanged(DatePicker view, int year, int month, int day) {
        super.onDateChanged(view, year, month, day);
        setTitle(titleContent);
    }
}